package com.ai.nsa.utils.page.model;

import com.ai.nsa.utils.hbase.model.HBaseRow;

import java.util.List;
import java.util.Map;

/**
 * HBase 页
 *
 * @author Feng Chen 2017/6/17.
 */
public class HBasePage extends AbstractPage<HBaseRow> {

    public HBasePage(List<HBaseRow> rows, int pageSize) {
        super(rows, pageSize);
    }

    @Override
    public Map<Integer, List<HBaseRow>> pages() {
        return pages;
    }

    @Override
    public int getTotalPage() {
        return totalPage;
    }

    @Override
    public int getTotalCount() {
        return totalCount;
    }

    @Override
    public List<HBaseRow> page(int pageNo) {
        if (pageNo > totalPage) {
            return null;
        }
        return pages.get(pageNo);
    }
}
